package com.dkd.http.controller;

import com.dkd.entity.dto.ChannelConfigDto;
import com.dkd.entity.vo.ChannelVo;
import com.dkd.service.ChannelService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 货道管理
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/channel")
@Api(tags = "售货机区货道")
public class ChannelController {
    private final ChannelService channelService;
    @ApiOperation("获取货道详情")
    @GetMapping("/channelList/{innerCode}")
    public List<ChannelVo> getDetails(@PathVariable("innerCode") String innerCode){
        return channelService.getDetails(innerCode);
    }
    @ApiOperation("货道配置")
    @PutMapping("/channelConfig")
    public boolean channelConfig(@RequestBody ChannelConfigDto channelConfigDto){
        return channelService.channelConfig(channelConfigDto);
    }

}
